const str = 'i am you father, you are my son, my wang , wang ';

// console.log(str.split('wang').length - 1)
let count = 0;
str.split(' ').forEach((item) => {
    if (item === 'wang') count++;
})

console.log(str.split(' ').filter((item) => item === 'wang').length)